home *** CD-ROM | disk | FTP | other *** search
/ United Public Domain Gold 2 / United Public Domain Gold 2.iso / music_utilities / pt030.dms / pt030.adf / Less / Src / help.c < prev    next >
C/C++ Source or Header  |  1987-06-15  |  3KB  |  93 lines

  1. #include  "less.h"
  2.  
  3. extern char editor[];
  4.  
  5. /*
  6.  * Display some help.
  7.  * Help is in two pages.
  8.  */
  9.     static void
  10. help0()
  11. {
  12.     bo_enter();
  13.     ttputs("&              Also print the current file. (NEW)\n");
  14.     bo_exit();
  15.     ttputs("f, SPACE       Forward one screen.\n");
  16.     ttputs("b,B            Backward one screen.\n");
  17.     ttputs("e, j, CR    *  Forward N lines, default 1.\n");
  18.     ttputs("y, k        *  Backward N lines, default 1.\n");
  19.     ttputs("d           *  Forward N lines, default 10 or last N to d or u command.\n");
  20.     ttputs("u           *  Backward N lines, default 10 or last N to d or u command.\n");
  21.     ttputs("r              Repaint screen.\n");
  22.     ttputs("g           *  Go to line N, default 1.\n");
  23.     ttputs("G           *  Like g, but default is last line in file.\n");
  24.     ttputs("=              Print current file name\n");
  25.     ttputs("/pattern    *  Search forward for N-th occurence of pattern.\n");
  26.     ttputs("?pattern    *  Search backward for N-th occurence of pattern.\n");
  27.     ttputs("n           *  Repeat previous search (for N-th occurence).\n");
  28.     ttputs("q,Q            Exit.\n");
  29.     error("More help...");
  30. }
  31.  
  32.     static void
  33. help1()
  34. {
  35.     char message[100];
  36.     extern char all_options[];
  37.  
  38.     ttputs("R              Repaint screen, discarding buffered input.\n");
  39.     ttputs("p, %        *  Position to N percent into the file.\n");
  40.     ttputs("m<letter>      Mark the current position with <letter>.\n");
  41.     ttputs("'<letter>      Return to a previously marked position.\n");
  42.     bo_enter();
  43.     ttputs("''             Return to previous position. (NEW)\n");
  44.     ttputs("-z<num>        set the number of lines scrolled. (NEW)\n");
  45.     bo_exit();
  46.     sprintf(message, 
  47.        "-X             Toggle a flag (one of \"%s\").\n",  all_options);
  48.     ttputs(message);
  49.     ttputs("E [file]       Examine a new file.\n");
  50.     ttputs("N              Examine the next file (from the command line).\n");
  51.     ttputs("P              Examine the previous file (from the command line).\n");
  52.     ttputs("V              Print version number.\n");
  53. #if SHELL_ESCAPE
  54.     ttputs("!command       Passes the command to a CLI to be executed.\n");
  55. #endif
  56. #if EDITOR
  57.     sprintf(message,
  58.          "v              Edit the current file (default editor:%s).\n",
  59.                 editor);
  60.     ttputs(message);
  61. #endif
  62.     error("");
  63. }
  64.  
  65.     public void
  66. help()
  67. {
  68.     register int i;
  69.  
  70.     for (i = 0;  i < 2;  i++)
  71.     {
  72.         clear();
  73.         so_enter();
  74.         ttputs("Amiga LESS 1.3 by\n");
  75.         ttputs("Bob Leivian      \n");
  76.          ttputs("2702 W. Curry St.");
  77.         so_exit();
  78.         ttputs("   ");
  79.         so_enter();
  80.         ttputs("comments and contributions welcome\n");
  81.         ttputs("Chandler AZ 85224");
  82.         so_exit();
  83.         
  84.         ttputs("\n\nCommands marked with * may be preceeded by a number, N.\n\n");
  85.  
  86.         switch (i)
  87.         {
  88.         case 0:         help0();        break;
  89.         case 1:         help1();        break;
  90.         }
  91.     }
  92. }
  93.